<?php
defined('IN_TS') or die('Access Denied.');

//全局通用定义
include_once '../public/php/defines.php';
include_once '../app/geoweibo/api/def.php';
include_once '../app/geoweibo/api/api_do.php';

switch($ts){
	//添加
    case "add":
    {
		//判断用户是否登录
		$user_id = aac("user")->isLoginMobile();
		if($user_id == FALSE) {
			$arr = array(
				FLAG_RET => ERROR,
				FLAG_ERR_CODE => ERR_NOT_LOGIN
			);
		} else {
			//读取表单
			$latitude = $_REQUEST["latitude"];
			$longtitude = $_REQUEST["longtitude"];
			$msg = $_REQUEST["msg"];
			$arr = add($new["geoweibo"], "img_name", $latitude, $longtitude, $msg, $user_id);
		}
        break;
    }
	
    default:
    {
        $arr = array(
            FLAG_RET => ERROR,
            FLAG_ERR_CODE => ERR_VAL
        );
        break;
    }
}

/*返回结果*/
echo json_encode($arr);

?>
